﻿<Window x:Class="WPF_Example.View.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="725">
    <Window.Resources>
        <Style x:Key="ControlStyle" TargetType="Control">
            <Setter Property="Margin" Value="5"></Setter>
            <Setter Property="Padding" Value="2"></Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="40px"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="350px"></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        
        <ItemsControl ItemsSource="{Binding Observers}" />
        
        <ContentControl Content="{Binding CurrentControl}" 
                        Grid.Column="1"/>
        
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="2*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Button Grid.Column="0" Content="CanMoveIn"
                    Command="{Binding CanMoveInCommand}"
                    Style="{StaticResource ControlStyle}" />
            <Button Grid.Column="1" Content="CanMoveIn"
                    Command="{Binding CanMoveOutCommand}"
                    Style="{StaticResource ControlStyle}" />
            <TextBox Grid.Column="2" Text="{Binding CanMoveResult}"
                    Style="{StaticResource ControlStyle}"
                    IsReadOnly="True"/>
        </Grid>
        
        <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Content="First" Command="{Binding GoToFirstCommand}" 
                    Style="{StaticResource ControlStyle}" />
            
            <Button Content="Previous" Command="{Binding GoToPreviousCommand}" 
                    Style="{StaticResource ControlStyle}"/>
            
            <Button Content="Next" Command="{Binding GoToNextCommand}" 
                    Style="{StaticResource ControlStyle}"/>
            
            <Button Content="Last" Command="{Binding GoToLastCommand}" 
                    Style="{StaticResource ControlStyle}"/>
        </StackPanel>
    </Grid>
</Window>